home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20000824-20010305
/
000379_news@columbia.edu _Fri Mar 2 09:49:57 2001.msg
< prev
next >
Wrap
Internet Message Format
|
2001-03-05
|
2KB
Return-Path: <news@columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by uhaligani.cc.columbia.edu (8.9.3/8.9.3) with ESMTP id JAA05841
for <kermit.misc@cpunix.cc.columbia.edu>; Fri, 2 Mar 2001 09:49:55 -0500 (EST)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id JAA14126
for kermit.misc@watsun.cc.columbia.edu; Fri, 2 Mar 2001 09:44:21 -0500 (EST)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: fdc@columbia.edu (Frank da Cruz)
Subject: Re: DATE Calculation script help needed
Date: 2 Mar 2001 14:44:20 GMT
Organization: Columbia University
Message-ID: <97obk4$dpc$1@newsmaster.cc.columbia.edu>
To: kermit.misc@columbia.edu
In article <3A9F7510.1934F92B@att.com>,
Siva K. Vejalla <svejalla@att.com> wrote:
: I need big help in writing the script which can give me the
: date X days back from today's date.
:
: Ex: datecheck 70 # Argument is No. of days
: # Assuming today's date is 013101
: # Output should be 112200
:
: It should consider previous month/year and Leap year or not
: etc.
:
: I tried it using shell script, but to include the previous
: year/month logic seems to be tricky & time consuming the way
: I am going.
:
: If it matters, i am trying this on a Unix (HP-UX 11.0)
: platform.
:
HP-UX comes with C-Kermit installed in /bin/kermit. Unfortunately
it's not the current version, which is 7.0 and which you can
find here:
http://www.columbia.edu/kermit/ckermit.html
In C-Kermit 7.0 the command is:
date +5days
Since you probably want to use the result for something, you can also
include expressions like this in commands for file selection, e.g.:
send /after:+5days *.txt
There is also a complete set of built-in functions for date and time
conversion and arithmetic. See:
http://www.columbia.edu/kermit/case17.html
- Frank